package com.ice.controller;


import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeepSeekChatController {

//    @Autowired
//    private OpenAiChatModel openAiChatModel;


    OpenAiChatModel openAiChatModel;

    public DeepSeekChatController(OpenAiChatModel openAiChatModel) {
        this.openAiChatModel = openAiChatModel;
    }

    @GetMapping("/deepseek/generate")
    public String generate(@RequestParam(value = "prompt", defaultValue = "hello") String prompt) {
        String response = openAiChatModel.call(prompt);
        System.out.println("response = " + response);
        return response;
    }

    public record DeepSeekResponse(String response) {

    }

}
